#ifndef INC_D3DX9MESHTOD3DX10MESH_H
#define INC_D3DX9MESHTOD3DX10MESH_H
#include "DXUT.h"
#include <d3d9.h>
#include <d3dx9.h>
#include "..\\IO\\Material.h"
#include <vector>
class XMeshConv
{
public:
	static HRESULT	ConvertDeclaration( const D3DVERTEXELEMENT9 original[ MAX_FVF_DECL_SIZE ], D3D11_INPUT_ELEMENT_DESC output[ MAX_FVF_DECL_SIZE ] );
	static LPCSTR			ConvertSemantic( const D3DDECLUSAGE& d3d9Form );
	static DXGI_FORMAT		ConvertType( const D3DDECLTYPE& d3d9Form );
	static HRESULT			CreateVertexBufferData( ID3DXMesh* pMesh9,	ID3D11Buffer** ppVB, ID3D11Device* pd3dDevice );	
	static HRESULT			CreateIndexBufferData( ID3DXMesh* pMesh9, ID3D11Buffer** ppIB, ID3D11Device* pd3dDevice );
	static HRESULT			ConfigureAttributeTable( ID3DXMesh* pMesh9, std::vector <MESH_ATTRIBUTE_RANGE> &Subsets);
	//static HRESULT         CreateD3D9NullRef( IDirect3DDevice9** ppCreatedDevice );
	static HRESULT CreateD3D11MeshFromD3DX9Mesh( ID3DXMesh* pInMesh, ID3D11Device *pDevice, ID3D11Buffer** ppVB, ID3D11Buffer** ppIB, 
		                                         std::vector <MESH_ATTRIBUTE_RANGE> &Subsets);
};

#endif
